package cn.com.fssg.platform.base.handler.impl;

import cn.com.fssg.platform.base.handler.TemplateHandler;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.deepoove.poi.config.ConfigureBuilder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author : xzt
 * @description :
 * @createDate : 2025/10/27 11:17
 */
public class TestExcelSheetHandler implements TemplateHandler {
    @Override
    public Map<String, Object> extend(Map<String, Object> dataMap, ConfigureBuilder configureBuilder) throws Exception {
        return null;
    }

    @Override
    public void excelExtend(ExcelWriter excelWriter, FillConfig fillConfig) throws Exception {
        WriteSheet writeSheet = EasyExcel.writerSheet(1).build();
        List<Map<String,Object>> datas = new ArrayList<>();
        HashMap<String, Object> data = new HashMap<>();
        data.put("a","测试填入多个sheet");
        datas.add(data);
        excelWriter.fill(datas,fillConfig,writeSheet);
    }
}

